import { defineStore } from "pinia";
import { LocationQueryValue } from "vue-router";

interface BookPath {
  bookPath: string | LocationQueryValue | LocationQueryValue[];
}

export const useBookStore = defineStore("bookStore", {
  persist: true, // 开启持久化
  state: (): BookPath => {
    return {
      bookPath: "" // 编辑书籍目录
    };
  },
  actions: {
    setBookPath(value: string | LocationQueryValue | LocationQueryValue[]) {
      this.bookPath = value;
    }
  }
});
